package team.yidong.fenda.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import team.yidong.fenda.entity.SysUser;

import java.util.List;

/**
 * Created by xuanlong on 2018/1/28.
 */
@Repository
public interface SysUserRepository extends JpaRepository<SysUser, Integer>, JpaSpecificationExecutor<SysUser> {
    SysUser findByUserName(String userName);

    @Query("select sysUser from SysUser sysUser where sysUser.sysUserRoleId<>1 and sysUser.sysUserRoleId<>3")
    List<SysUser> findHospitalAdmin();

    List<SysUser> findByUserNameLike(String userName);

}
